<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="UTF-8">
    <title>SSO Client - 用户详细信息</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
    <style>
        body {
            padding-top: 20px;
            background-color: #f8f9fa;
        }
        .container {
            max-width: 900px;
        }
        .card {
            margin-top: 20px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .card-header {
            background-color: #007bff;
            color: white;
        }
        pre {
            background-color: #f8f9fa;
            padding: 10px;
            border-radius: 4px;
            overflow-x: auto;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="text-center">
            <h1 class="display-4">用户详细信息</h1>
            <p class="lead">OIDC认证提供的用户信息</p>
        </div>
        
        <div class="card">
            <div class="card-header">
                <h3>用户基本信息</h3>
            </div>
            <div class="card-body">
                <p><strong>用户名:</strong> <span th:text="${user.fullName != null ? user.fullName : user.preferredUsername}"></span></p>
                <p><strong>邮箱:</strong> <span th:text="${user.email}"></span></p>
                <p><strong>用户ID:</strong> <span th:text="${user.subject}"></span></p>
                <p><strong>认证时间:</strong> <span th:text="${user.authenticatedAt}"></span></p>
            </div>
        </div>
        
        <div class="card">
            <div class="card-header">
                <h3>所有用户属性</h3>
            </div>
            <div class="card-body">
                <pre th:text="${T(com.alibaba.fastjson.JSON).toJSONString(attributes, true)}"></pre>
            </div>
        </div>
        
        <div class="card">
            <div class="card-header">
                <h3>用户声明 (Claims)</h3>
            </div>
            <div class="card-body">
                <pre th:text="${T(com.alibaba.fastjson.JSON).toJSONString(claims, true)}"></pre>
            </div>
        </div>
        
        <div class="mt-4 text-center">
            <a th:href="@{/home}" class="btn btn-primary">返回主页</a>
            <form th:action="@{/logout}" method="post" style="display: inline-block;">
                <button type="submit" class="btn btn-danger">退出登录</button>
            </form>
        </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>